<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->
	
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/pro_drop_1.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/stuHover.js"></script>
	<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/checkday.js"></script>
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>

</head>
<body>
<div class="container" id="page">
	<div id="header">
			<div id="logo">
				Logo Exim bank
			</div>			
		</div>
	<div id="mainmenu">
	<ul id="nav">	
		<!-- Guest -->
		<?php if(Yii::app()->user->isGuest):?>

		<li class="top"><?php echo CHtml::link('<span>Đăng nhập</span>',array('site/login'), array('class'=>'top_link')); ?></li>
		<li class="top"><?php echo CHtml::link('<span>Liên hệ</span>',array('site/page', 'view'=>'about'), array('class'=>'top_link')); ?></li>
		<?php endif; ?>
		
		<!-- Clerk -->
		<?php if(Yii::app()->user->checkAccess('clerk')):?>
		<li class="top"><?php echo CHtml::link('<span>Danh sách công việc</span>',array('job/admin'), array('class'=>'top_link')); ?></li>
		<li class="top"><?php echo CHtml::link('<span class="down">Thống kê</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
			<li><?php echo CHtml::link('<span class="down">Theo ngày</span>',array('job/report')); ?></li>
			</ul>
		</li>
		<li class="top"><?php echo CHtml::link('<span class="down">Xin chào, '.Yii::app()->user->fullname.'</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
				<li><?php echo CHtml::link('<span>Thông tin tài khoản</span>',array('userProfile/view', 'id'=>Yii::app()->user->id)); ?></li>
				<li><?php echo CHtml::link('<span>Thoát khỏi hệ thống</span>',array('site/logout'), array('confirm'=>'Bạn chắc chắn muốn thoát khỏi hệ thống ?')); ?></li>
			</ul>
		</li>
		<?php endif; ?>
		
		<!-- Manager -->
		
		<?php if(Yii::app()->user->checkAccess('manager') && !Yii::app()->user->checkAccess('admin')):?>
		
		<li class="top"><?php echo CHtml::link('<span class="down">Quản lý</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
			<li><?php echo CHtml::link('<span class="down">Người dùng</span>',array('user/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('user/create')); ?></li>
				</ul>
			</li>
			
			<li><?php echo CHtml::link('<span class="down">Nhóm công việc</span>',array('jobGroup/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('jobGroup/create')); ?></li>
				</ul>
			</li>

			<li><?php echo CHtml::link('<span class="down">Tiếp nhận phân công</span>',array('receivingAssigning/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('receivingAssigning/create')); ?></li>
				</ul>
			</li>

			<li><?php echo CHtml::link('<span class="down">Bảo hành sữa chữa</span>',array('warrantyFixing/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('warrantyFixing/create')); ?></li>
				</ul>
			</li>

			<li><?php echo CHtml::link('<span class="down">Mua sắm thiết bị</span>',array('buyingEquipment/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('buyingEquipment/create')); ?></li>
				</ul>
			</li>
			</ul>
		</li>
		<li class="top"><?php echo CHtml::link('<span class="down">Thống kê</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
			<li><?php echo CHtml::link('<span class="down">Công việc</span>',Yii::app()->request->requestUri.'#', array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Theo thời gian</span>',array('job/statisticsTime')); ?></li>
					<li><?php echo CHtml::link('<span class="down">Theo nhân sự</span>',array('job/statisticsUser')); ?></li>
					<li><?php echo CHtml::link('<span class="down">Theo nhóm công việc</span>',array('job/statisticsJobGroup')); ?></li>
				</ul>
			</li>	
			<li><?php echo CHtml::link('<span class="down">Tiếp nhận phân công</span>',array('/receivingAssigning/report')); ?></li>
			<li><?php echo CHtml::link('<span class="down">Bảo hành sửa chữa</span>',array('/warrantyFixing/report')); ?></li>
			<li><?php echo CHtml::link('<span class="down">Mua sắm thiết bị</span>',array('/buyingEquipment/report')); ?></li>

			</ul>
		</li>
		<li class="top"><?php echo CHtml::link('<span class="down">Xin chào, '.Yii::app()->user->fullname.'</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
				<li><?php echo CHtml::link('<span>Thông tin tài khoản</span>',array('userProfile/view', 'id'=>Yii::app()->user->id)); ?></li>
				<li><?php echo CHtml::link('<span>Thoát khỏi hệ thống</span>',array('site/logout'), array('confirm'=>'Bạn chắc chắn muốn thoát khỏi hệ thống ?')); ?></li>
			</ul>
		</li>
		<?php endif; ?>
		
		<!-- Admin -->
		<?php if(Yii::app()->user->checkAccess('admin')):?>
		
		<li class="top"><?php echo CHtml::link('<span class="down">Quản lý</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
			<li><?php echo CHtml::link('<span class="down">Người dùng</span>',array('user/admin'), array('class'=>'fly')); ?>
				<ul>
					<li><?php echo CHtml::link('<span class="down">Thêm mới</span>',array('user/create')); ?></li>
				</ul>
			</li>
			</ul>
		</li>
		<li class="top"><?php echo CHtml::link('<span class="down">Xin chào, '.Yii::app()->user->fullname.'</span>', Yii::app()->request->requestUri.'#', array('class'=>'top_link')); ?>
			<ul class="sub">
				<li><?php echo CHtml::link('<span>Thông tin tài khoản</span>',array('userProfile/view', 'id'=>Yii::app()->user->id)); ?></li>
				<li><?php echo CHtml::link('<span>Thoát khỏi hệ thống</span>',array('site/logout'), array('confirm'=>'Bạn chắc chắn muốn thoát khỏi hệ thống ?')); ?></li>
			</ul>
		</li>
		<?php endif; ?>
		
	</ul>
	</div><!-- mainmenu -->

	<?php echo $content; ?>
	<div id="footer"  class="bg-1">
		Bản quyền thuộc về Exim Bank. Năm <?php echo date('Y'); ?> <br/>
	</div><!-- footer -->

</div><!-- page -->
</body>
</html>